<?php

include_once 'PedidosControl.php';

if (!isset($_SESSION)){
	session_start();
}

$foto = $_FILES['comprovante'];
$tmp_name  = $_FILES['comprovante']['tmp_name'];
$file_size = $_FILES['comprovante']['size'];
$type = $_FILES['comprovante']['type'];
if($tmp_name != null)
{

	$fp = fopen($tmp_name, 'r');
	$file_content = fread($fp, $file_size) or die("Error: cannot read file");
	$file_content = addslashes($file_content) or die("Error: cannot read file");
	fclose($fp);
}

PedidosControl::gerarPedido($_SESSION["idOrcamentoAtual"], $file_content);

header("Location: MinhaTelaCliente.php");
?>